fix(deps): declare cooklang's bundled_units feature explicitly#371
Conversation
ReviewSmall, well-scoped fix — reviewed the diff ( Code quality / correctness
Bugs / security / performance
Test coverage
Process note
Overall: looks good to merge once #370 lands and CI is green, per the stated dependency in the PR description. |
bundled_units carries the unit database behind quantity scaling and unit
normalisation. cook recipe depends on it, but cookcli never declared it:
it was reaching us purely through cargo feature unification, because
cooklang-language-server and cooklang-reports depend on cooklang with
default features.
Any dependency change that dropped those crates from the graph would
silently alter recipe output - units stop normalising ('cups' instead of
'c') and quantities stop being scalable. Declare it where it is used.
No-op today: resolved cooklang features and crate count are identical.
Refs #366
88d947a to
e803544
Compare
ReviewSmall, well-scoped change — reviewed the diff and PR description. Summary: Code quality
Bugs / correctnessNone spotted. The change is additive-only (one feature flag), and the PR body includes solid before/after evidence (identical resolved feature set and crate count on PerformanceNo impact — no new crates pulled in, no size/build-time change, as already confirmed in the PR description. SecurityNo concerns — internal Cargo feature-flag change only, no new dependencies or attack surface. Test coverageThere's no new automated test that pins the resolved Overall: LGTM, nice catch and a clean, minimal fix. |
0.2.4 stops enabling cooklang's bundled_units feature, which it never used. Before #371 that would have silently changed cook recipe output, because we were relying on the language server to turn bundled_units on for us via feature unification. We now declare it ourselves, so this bump is a no-op for recipe output - snapshots are unchanged. Refs #366
Split out of #369 so it can land on its own — it fixes a latent correctness issue that exists on
mainright now, independent of any refactoring.The bug
bundled_unitsis thecooklangfeature carrying the unit database — it is what makes quantities scalable and normalises units.cook recipedepends on it.cookcli never declared it. Our manifest says:
The feature has been arriving purely through Cargo feature unification:
cooklang-language-serverandcooklang-reportsboth depend oncooklangwith default features, andcooklang's defaults includebundled_units. We have been getting it by accident.That means any dependency change which drops those crates from the graph silently changes recipe output:
"quantity": { - "scalable": true, - "unit": "cups", + "scalable": false, + "unit": "c",Nothing about that is obvious from our manifest, and nothing warns you. I only found it because gating
lspoff in #369 droppedcooklang-language-serverand the snapshot tests went red.The fix
Declare
bundled_unitsin our owncooklangdependency, where it is actually used.Verification — this is a no-op today
The point of the change is that it is invisible now and load-bearing later. Confirmed on aarch64:
cooklangfeaturesmaincargo test— 13 suites pass, snapshots unchanged (recipe output byte-identical)Needs #370 to land first for CI to go green (clippy is broken on
mainby the Rust 1.97 toolchain bump).Refs #366